package com.example.m_kartupay;

import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.Toast;
import android.app.Activity;
import android.content.Intent;

public class HelpActivity extends Activity {

	 ListView list;
	 String[] help = {
			      "FAQ",
			      "Contact Customer Support",
			      "Terms & Conditions",
			      "Privacy & Policy",
			      "About Kartu Pay"
			      	      
     } ;
	 Integer[] imageId = {
			  R.drawable.abc_ic_go_search_api_holo_light,
		      R.drawable.abc_ic_go_search_api_holo_light,
		      R.drawable.abc_ic_go_search_api_holo_light,
		      R.drawable.abc_ic_go_search_api_holo_light,
		      R.drawable.abc_ic_go_search_api_holo_light
		   
			 /*
		      R.drawable.phone45,
		      R.drawable.tablet26,
		      R.drawable.telephone47,
		      R.drawable.email23,
		      R.drawable.smartphone13,
		      R.drawable.buying4,
		      R.drawable.smartphone14,
		      R.drawable.telephone43,
		      R.drawable.smartphone9,
		      */
		  };
	 @Override
	  protected void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    setContentView(R.layout.helps);
	    ListMenuActivity adapter = new
	    		ListMenuActivity(HelpActivity.this, help, imageId);
	    list=(ListView)findViewById(R.id.listhelp);
	        list.setAdapter(adapter);
	        list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
	                @Override
	                public void onItemClick(AdapterView<?> parent, View view,
	                                        int position, long id) {
	                    Toast.makeText(HelpActivity.this, "You Clicked at " +help[+ position], Toast.LENGTH_SHORT).show();
	                    String _menu = help[+position];
	                   // Toast.makeText(MainMenuActivity.this, "You Clicked at " +menu[+ position], Toast.LENGTH_SHORT).show();
	                    
	                    // Buat Switch untuk pemilihan intent
	                    
	                    
	                   switch(_menu)
	                   {
		                
		                   case "FAQ":
		                	   Intent faq =  new Intent(view.getContext(), FAQActivity.class);
		                	   startActivity(faq);
		                	   break;
		                 
	                   }                  
	                 	                    
	                   
	    				//in.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
	    			    //in.putExtra("kirim", "Hallo Saya dari FirstActivity");
	    			   
	    			    
	                
	                }
	            });
	  }
}
